Math (math)

Generating random numbers (random)

Create a random number <1 (<1)

Return the next random floating point number in the range [0.0, 1.0).

 

{ }
[{"paths":[],"data":{"math":"math","call":"math.random.<1","math.random.<1":"<1","uuid":"071651f79538c5be3173b651cc9bcb7e","args":{},"height":32,"width":120,"step":"get random < 1","data_to_var":"rnd","y":0,"x":0,"type":"library","maxpaths":1}}]

Example Response

{"rnd":0.12526941771052091}

Create a random integer (int)

Return a random integer N such that a <= N <= b.

 

{ }
[{"paths":[],"data":{"math":"math","call":"math.random.int","math.random.int":"int","uuid":"071651f79538c5be3173b651cc9bcb7e","args":{"min":0,"max":50},"height":32,"width":120,"step":"get random int","data_to_var":"rnd","y":0,"x":0,"type":"library","maxpaths":1}}]

Example Response

{"rnd":42}

Create a random number within a range (range)

Return a randomly selected element from range(start, stop, step). This is equivalent to choice(range(start, stop, step)), but doesn’t actually build a range object.

 

{ }
[{"paths":[],"data":{"math":"math","call":"math.random.range","math.random.range":"range","uuid":"071651f79538c5be3173b651cc9bcb7e","args":{"min":0,"max":50,"step":2},"height":32,"width":120,"step":"get random using range","data_to_var":"rnd","y":0,"x":0,"type":"library","maxpaths":1}}]

Example Response

{"rnd":10}